package com.zito.health.controller;

import com.zito.health.common.annotations.ResponseResult;
import com.zito.health.common.result.PlatformResult;
import com.zito.health.common.result.VerifyResult;
import com.zito.health.entity.Item;
import com.zito.health.entity.ItemResearcher;
import com.zito.health.service.ItemResearcherService;
import com.zito.health.service.ItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 项目研究人员
 */
@Slf4j
@RestController
@RequestMapping("/item/researcher")
public class ItemResearcherController {

    @Autowired
    private ItemResearcherService itemResearcherService;

    @PostMapping("/save")
    public PlatformResult save(ItemResearcher item){
        itemResearcherService.save(item);
        return  PlatformResult.success();
    }

    @PostMapping("/update")
    public PlatformResult update(ItemResearcher item){
        itemResearcherService.update(item);
        return  PlatformResult.success();
    }

    @PostMapping("/list")
    public PlatformResult list(ItemResearcher item){
        return PlatformResult.success(itemResearcherService.query(item));
    }

    @PostMapping("/delete")
    public PlatformResult delete(Integer id){
        itemResearcherService.delete(id);
        return  PlatformResult.success();
    }

    @PostMapping("/query")
    public PlatformResult query(ItemResearcher item){
        return PlatformResult.success(itemResearcherService.queryOne(item));
    }
}
